package acm.usa1995.midcentral;

import java.util.Arrays;

/*
 * p1945
 * ACM Mid-Central USA 1994
 */

public class p1945 {
	
	static int a, b, c, d;
	static int[] num;

	public static void main(String[] args) {

		num = new int[201];
		for (int i=0;i<=200;++i) {
			num[i] = i*i*i;
		}
		
		for (int i=2;i<=200;++i) {
			a = num[i];
			for (int j=2;j<i;++j) {
				b = num[j];
				for (int k=j;k<i;++k) {
					c = num[k];
					d = a - b - c;
					if (d > 0) {
						int l = Arrays.binarySearch(num, d);
						if (l >= k && l < i) {
							System.out.println("Cube = " + i + ", Triple = (" + j +"," + k + "," + l + ")");
						}
					}
				}
			}
		}

	}

}
